package com.xlcszsgc.core.util;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;

public class SpringBeanUtil {
	private static ApplicationContext ac;

	public static ApplicationContext getAc() {
		return ac;
	}

	public static void setAc(ApplicationContext ac) {
		SpringBeanUtil.ac = ac;
	}

	public static boolean containsBean(String arg0) {
		return ac.containsBean(arg0);
	}

	public static String[] getAliases(String arg0) {
		return ac.getAliases(arg0);
	}

	public static <T> T getBean(Class<T> arg0) throws BeansException {
		return ac.getBean(arg0);
	}

	public static <T> T getBean(String arg0, Class<T> arg1)
			throws BeansException {
		return ac.getBean(arg0, arg1);
	}

	public static Object getBean(String arg0, Object... arg1)
			throws BeansException {
		return ac.getBean(arg0, arg1);
	}

	public static Object getBean(String arg0) throws BeansException {
		return ac.getBean(arg0);
	}

	public static String[] getBeanNamesForType(Class arg0, boolean arg1,
			boolean arg2) {
		return ac.getBeanNamesForType(arg0, arg1, arg2);
	}

	public static String[] getBeanNamesForType(Class arg0) {
		return ac.getBeanNamesForType(arg0);
	}

	public ClassLoader getClassLoader() {
		return ac.getClassLoader();
	}
}
